!(function (doc, win) {
  var docEle = doc.documentElement,
    evt = "resize"

  fn = function () {
    var width = docEle.clientWidth;
    width = width < 320 ? 320 : width;
    width = width > 720 ? 720 : width;
    width && (docEle.style.fontSize = 100 * (width / 720) + "px");

    // console.log('run autoRem');
    setTimeout(function () {
      var width = docEle.clientWidth;
      width = width < 320 ? 320 : width;
      width = width > 720 ? 720 : width;
      width && (docEle.style.fontSize = 100 * (width / 720) + "px");
    }, 333);//延迟0.3秒再执行一遍，解决某些手机横竖屏转换问题
  };

  win.addEventListener(evt, fn, false);
  doc.addEventListener("DOMContentLoaded", fn, false);

  fn()
}(document, window));
